using UnityEngine;
using QFramework;
using QAssetBundle;

namespace ProjectSurviver
{
	public partial class TreasuerChest : GamePlayObject
	{
        public override Collider2D Collider2D => SelfCollider2D;

		void OnTriggerEnter2D(Collider2D other)
        {
            if(other.GetComponent<CollectableArea>())
			{
				UIGamePanel.OpenTreasurePanel.Trigger();
				AudioKit.PlaySound(Sfx.TREASUERCHEST);
				this.DestroyGameObjGracefully();
			}
        }
	}
}
